
<% import grails.persistence.Event %>
<%=packageName%>
<!DOCTYPE html>
<html>
<head>
<meta name="layout" content="main">
<g:set var="entityName"
	value="\${message(code: '${domainClass.propertyName}.label', default: '${className}')}" />
<title><g:message code="default.show.label" args="[entityName]" /></title>
</head>
<body>
	<div class="nav" role="navigation">

		<ul class="nav nav-pills">
			<g:permissao devePossuir="true"
				controles="${domainClass.propertyName}" acoes="list">
				<li><g:link class="list" action="list">
						<i class="icon-list-alt"></i>
						<g:message code="default.list.label" args="[entityName]" />
					</g:link></li>
			</g:permissao>
			<li class="divider-vertical"></li>
			<g:permissao devePossuir="true"
				controles="${domainClass.propertyName}" acoes="create">
				<li><g:link action="create">
						<i class="icon-file"></i>
						<g:message code="default.add.label" args="[entityName]" />
					</g:link></li>
			</g:permissao>
		</ul>







	</div>
	<div id="show-${domainClass.propertyName}"
		class="content scaffold-show" role="main">
		<legend>
			<g:message code="default.show.label" args="[entityName]" />
		</legend>
		<mensagem:renderizar mensagem="\${flash}" />
		<ol class="property-list ${domainClass.propertyName}">
			<%  excludedProps = Event.allEvents.toList() << 'id' << 'version'
				allowedNames = domainClass.persistentProperties*.name << 'dateCreated' << 'lastUpdated'
				props = domainClass.properties.findAll { allowedNames.contains(it.name) && !excludedProps.contains(it.name) }
				Collections.sort(props, comparator.constructors[0].newInstance([domainClass] as Object[]))
				props.each { p -> %>
				<g:if test="\${${propertyName}?.${p.name}}">
				<p class="muted">
					<span id="${p.name}-label" class="property-label"><g:message code="${domainClass.propertyName}.${p.name}.label" default="${p.naturalName}" />:</span>
					<%  if (p.isEnum()) { %>
						<strong><g:fieldValue bean="\${${propertyName}}" field="${p.name}"/></strong>
					<%  } else if (p.oneToMany || p.manyToMany) { %>
						<g:each in="\${${propertyName}.${p.name}}" var="${p.name[0]}">
						<strong><g:link controller="${p.referencedDomainClass?.propertyName}" action="show" id="\${${p.name[0]}.id}">\${${p.name[0]}?.encodeAsHTML()}</g:link></strong>
						</g:each>
					<%  } else if (p.manyToOne || p.oneToOne) { %>
						<strong><g:link controller="${p.referencedDomainClass?.propertyName}" action="show" id="\${${propertyName}?.${p.name}?.id}">\${${propertyName}?.${p.name}?.encodeAsHTML()}</g:link></strong>
					<%  } else if (p.type == Boolean || p.type == boolean) { %>
						<strong><g:formatBoolean boolean="\${${propertyName}?.${p.name}}" /></strong>
					<%  } else if (p.type == Date || p.type == java.sql.Date || p.type == java.sql.Time || p.type == Calendar) { %>
						<strong><g:formatDate date="\${${propertyName}?.${p.name}}" /></strong>
					<%  } else if(!p.type.isArray()) { %>
						<strong><g:fieldValue bean="\${${propertyName}}" field="${p.name}"/></strong>
					<%  } %>
				</p>
				</g:if>
			<%  } %>
		</ol>
		<g:form>
			<fieldset class="buttons">
				<g:hiddenField name="id" value="\${${propertyName}?.id}" />
				<button type="submit" name="_action_edit" class="btn"
					value="\${message(code: 'default.button.update.label', default: 'Update')}">
					<i class="icon-ok"></i> Editar
				</button>

				<button type="submit" name="_action_delete" class="btn"
					value="\${message(code: 'default.button.delete.label', default: 'Delete')}"
					onclick="return confirm('\${message(code: 'default.button.delete.confirm.message', default: 'Tem certeza que deseja remover?')}');">
					<i class="icon-trash"></i> Remover
				</button>
			</fieldset>
		</g:form>
	</div>
</body>
</html>
